package com.java.diary.dao;

import java.io.Serializable;

public class Diary implements Serializable {
    private static int code;
    private String title;
    private String content;

    public Diary() {
    }

    public Diary(int code, String title, String content) {
        this.code = code;
        this.title = title;
        this.content = content;
    }

    public Diary(String title, String content) {
        this.code++;
        this.title = title;
        this.content = content;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "Diary{" +
                "code=" + code +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
}
